//package com.ntes.consumer2;
//
//import com.ntes.consumer2.service.IDemoService;
//import java.util.HashMap;
//import java.util.Map;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.CommandLineRunner;
//import org.springframework.boot.SpringApplication;
//import org.springframework.boot.autoconfigure.SpringBootApplication;
//import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
//import org.springframework.cloud.netflix.feign.EnableFeignClients;
//
///**
// * spring boot启动非web工程
// * Created by bjliuyue1 on 2017/5/19.
// */
//@EnableFeignClients
//@EnableDiscoveryClient
//@SpringBootApplication //scanBasePackages指定要扫描的包
//public class Comsumer2Application2 implements CommandLineRunner {
//
//    public static void main(String[] args) {
//        SpringApplication.run(Comsumer2Application2.class, args);
//    }
//
//    @Autowired
//    private IDemoService demoService;
//
//    @Override
//    public void run(String... strings) throws Exception {
//        Map<String, Integer> map = new HashMap<>();
//        String result;
//        int i = 0;
//        while (i++ < 1000) {
//            result = demoService.getString(null);
//            //            System.out.println(result);
//            if (map.get(result) != null) {
//                map.put(result, map.get(result) + 1);
//            }
//            else {
//                map.put(result, 1);
//            }
//        }
//        for (Map.Entry entry : map.entrySet()) {
//            System.out.println(entry.getKey() + ":" + entry.getValue());
//        }
//    }
//}
